#{extends 'common/supervisor.html' /} 
#{set title:'已完成的借款标列表' /} 

<div class="xn_c_contentwarp">
  <div class="xn_c_contentlist">
    #{include "supervisor/billCollectionManager/common/billCollectionManagerLeft.control"/}
    <div class="xn_c_content">
      <div class="xf_ht_tablelist">
        <!-- 搜索 -->
        #{form @repaymentListToDep(), id:'repaymentListToDep'}
        <input type="hidden" id="currPage" name="currPage"/>
        <input type="hidden" id="pageSize" name="pageSize"/>
        <input type="hidden" id="orderIndex" name="orderIndex"/>
        <input type="hidden" id="orderStatus" name="orderStatus"/>
        <div class="xf_ht_search">
          <div class="xf_ht_search_l">
            <span id="order0"><a title="默认排序" onclick="orderSearch(0);">默认排序</a></span>
			<span id="order10"><a title="最后还款时间  " onclick="orderSearch(10);">最后还款时间   <a id="sp10">↑</a></a></span>
			<span id="order9"><a title="逾期账单数量 " onclick="orderSearch(9);">逾期账单数量 <a id="sp9">↑</a></a></span>
          </div>
        </div>
        <div class="xf_ht_search_inon">
          <div class="xf_ht_search_r">
            <div class="xf_ht_search_xl">
              <select name="condition" class="xf_membill_selectAge">
                <option value="0" id="type0">全部</option>     
                <option value="1" id="type1">标题</option>   
                <option value="2" id="type2">编号</option>
              </select>
            </div>
            <div class="xf_ht_search_xl">
              <span class="search_timesp">最后还款时间：</span>
              <input name="startDate" type="text" id="startDate" class="search_time" onclick="laydate()" style="cursor: pointer" />
              <span class="search_timesp">--</span>
              <input name="endDate" type="text" id="endDate" class="search_time" onclick="laydate()" style="cursor: pointer" />
            </div>
            <div class="xf_ht_search_xl">
              <input type="text" name="keyword" id="keyword" class="search_w" />
            </div>
            <div class="xf_ht_search_xl">
              <input type="submit" class="search_button" value="搜 索" />
            </div>
          </div>
        </div>
        #{/form}
        <!-- 列表内容 -->
        <div class="xn_c_content_top">
          #{table class:"xn_c_content_list",cellspacing:"0",cellpadding:"0",border:"0",tr_class_odd:"xn_tr_bj"}
            #{tr}
              #{th}序号#{/th}
              #{th}编号#{/th}
              #{th}标题#{/th}
              #{th}借款人#{/th}
              #{th}信用等级#{/th}
              #{th}借款金额#{/th}
              #{th}借款标类型#{/th}
              #{th}年利率#{/th}
              #{th}借款期限#{/th}
              #{th}放款时间#{/th}
              #{th}已还期数#{/th}
              #{th}最后还款时间#{/th}
              #{th}逾期账单数量#{/th}
              #{th}客服#{/th}
              #{th}操作#{/th}
            #{/tr}
            #{list pageBean?.page}
            #{tr tr_index:_index}
              #{td}${(pageBean?.currPage - 1) * pageBean?.pageSize + _index}#{/td}
              #{td}${_?.bid_no}#{/td}
              #{td}${_?.title}#{/td}
              #{td}${_?.user_name}#{/td}
              #{td}#{img src:"${_?.credit_level_image_filename}",alt:"",width:"25",height:"25"}#{/img}#{/td}
              #{td}${_?.amount?.format('###,##0.00')}#{/td}
              #{td}#{img src:"${_?.small_image_filename}",alt:"",width:"20",height:"20"}#{/img}#{/td}
              #{td}${_?.apr}%#{/td}
              #{td}
                ${_?.period} 
                #{if _?.period_unit == -1} 
                [年] 
                #{/if} 
                #{elseif _?.period_unit == 1}
                [日] 
                #{/elseif} 
                #{else} 
                [月] 
                #{/else}
              #{/td}
              #{td}${_?.audit_time?.format('yyyy-MM-dd')}#{/td}
              #{td}${_?.repayment_count}#{/td}
              #{td}${_?.last_repay_time?.format('yyyy-MM-dd')}#{/td}
              #{td}${_?.overdue_count}#{/td}
              #{td}
                #{if _?.supervisor_name == null || _?.supervisor_name == ""}
                  暂无分配
                #{/if}
                #{else}
                  ${_?.supervisor_name}
                #{/else}
              #{/td}
              #{td}
                <a class="xf_ta_onclick" href="@{detailToDep(_?.id, 14, 208)}" class="xf_ta_onclick">详情</a>
              #{/td}
            #{/tr}
            #{/list}
          #{/table}
        </div>
        <!-- 列表底部 -->
        <div class="xn_c_content_bottom">
          <div class="page_warp">
            #{page currPage:pageBean.currPage,totalCount:pageBean.totalCount,pageSize:pageBean.pageSize,theme:2,style:4/}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">
<!--
	/* 条件搜素查询 */
	function showPage(currPage, pageSize){
	  $("#currPage").val(currPage);
	  $("#pageSize").val(pageSize);
	  $("#repaymentListToDep").submit();
	}
	  
	/* 排序搜索 */
	function orderSearch(order){
		var orderStatus = "${pageBean?.conditions?.orderStatus}";
		var orderIndex = "${pageBean?.conditions?.orderIndex}";
		
		if(orderStatus == 1 && orderIndex == order){
			$("#orderStatus").val(0);
		}else{
			$("#orderStatus").val(1);
		}
		
		$("#orderIndex").val(order);
		$("#repaymentListToDep").submit();
	}
	  
	$(function(){
	  /* 高亮样式 */
	  showHighLight(2, 2, 14);
	    
	  $('#bgTab').find('tr:even').find('td').css('background-color', '#f4f4f4');
	      
	  /* 给搜索条件赋记录值 */
	  var condition = "${pageBean?.conditions?.condition}";
	  var keyword = "${pageBean?.conditions?.keyword}";
	  var startDate = "${pageBean?.conditions?.startDate}";
	  var endDate = "${pageBean?.conditions?.endDate}";
	  var orderIndex = "${pageBean?.conditions?.orderIndex}";
	  $("#orderIndex").val(orderIndex);
	  var orderStatus = "${pageBean?.conditions?.orderStatus}";
	  $("#orderStatus").val(orderStatus);
	  var order = $("#order" + orderIndex);
	      
	  switch(parseInt(condition)){
	  case 0:$("#type0").attr("selected","selected");break;
	  case 1:$("#type1").attr("selected","selected");break;
	  case 2:$("#type2").attr("selected","selected");break;
	  }
	      
	  $("#keyword").val(keyword);
	  $("#startDate").val(startDate);
	  $("#endDate").val(endDate);
	      
	  /* 初始为默认搜索 */
		if(orderIndex == ''){
			$("#order0").attr("class", "xf_sea_isshow");
		}else {
		  order.attr("class", "xf_sea_isshow");
		  if(orderStatus == 1){
		     $("#sp"+orderIndex).html("↑");
		  }else{
		    $("#sp"+orderIndex).html("↓");
		  }
		}
	});
//-->
</script>
